package com.cn.gxa.redisutils.controller;

import com.cn.gxa.redisutils.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
public class ToHtml {
    @RequestMapping("/toIndex")
    public  String  toIndex(){
       return "index";
    }
    @RequestMapping("/toLogin")
    public  String  toLogin(){
        return "login";
    }
    @Autowired
    private TestService  testService;

    @RequestMapping("/save")
    public  String  save(){
        Map<String,Object>  map=new HashMap<>();
        map.put("name","韩梅梅");
        map.put("age","19");
        map.put("sex","男");
        map.put("address","成都");
        testService.save(map);
        return "login";
    }

}
